import request from '../../utils/request';
// 左边菜单列表
export function menuList (params){
    return request({
        url:window.poIP+ "/uap/pageResource",
        method: 'get',
        params: params
    });
};
// 获取菜单管理列表
export function getMenuList (params){
    return request({
        url:window.poIP+`/web/pageResource/list/${sessionStorage.getItem('roleId')}`,
        method: 'get',
        params: params
    });
};
// 新增菜单
export function addMenu (params){
    return request({
        url:window.poIP+ "/web/pageResource",
        method: 'post',
        data: params,
        headContype:true
    });
};
// 删除菜单
export function delMenu (params){
    return request({
        url:window.poIP+ "/web/pageResource/" + params.id,
        method: 'DELETE',
        params: params
    });
};
// 查看菜单编辑详情
export function lookMenuDetail (params){
    return request({
        url:window.poIP+ "/web/pageResource/" + params.id,
        method: 'get'
    });
};
// 编辑菜单
export function editMenu (params){
    return request({
        url:window.poIP+ "/web/pageResource",
        method: 'PUT',
        data: params,
        headContype:true
    });
};
// 获取菜单按钮列表数据
export function getMenuBtnList (params){
    return request({
        url:window.poIP+ "/fuction/resource",
        method: 'get',
        params: params
    });
};
// 批量删除菜单按钮列表
export function batchDelList (params){
    return request({
        url:window.poIP+ "/fuction/resource/list",
        method: 'DELETE',
        data: params,
        params: params,
        headContype:true
    });
};
// 单个删除菜单按钮列表
export function siginDelList (params){
    return request({
        url:window.poIP+ `/fuction/resource/${params.id}`,
        method: 'DELETE'
    });
};
//新增菜单按钮
export function addMenuList (params){
    return request({
        url:window.poIP+ `/fuction/resource`,
        method: 'post',
        data: params,
        headContype:true
    });
};
//编辑菜单按钮
export function editMenuList (params){
    return request({
        url:window.poIP+ `/fuction/resource`,
        method: 'PUT',
        data: params,
        headContype:true
    });
};
//获取菜单按钮编辑详情数据
export function getEditDetail (params){
    return request({
        url:window.poIP+ `/fuction/resource/${params.id}`,
        method: 'get',
        data: params
    });
};

//****************************************************** APP功能池 *****************************//
// 获取APP功能池按钮列表数据
export function getFunctionClassifyList (params){
    return request({
        url:window.poIP+ "/app/pageResource/v0.1/classify/list",
        method: 'get',
        params: params
    });
};
// 批量删除APP功能池按钮列表
export function batchAppDelList (params){
    return request({
        url:window.poIP+ "/app/pageResource/v0.1/classify/deleteList",
        method: 'DELETE',
        data: params,
        params: params,
        headContype:true
    });
};
// 单个删除APP功能池按钮列表
export function siginAppDelList (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/classify/${params.id}`,
        method: 'DELETE'
    });
};
//新增APP功能池功能分类
export function addAppFunction (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/classify`,
        method: 'post',
        data: params
    });
};
//编辑APP功能池分类
export function editApp(params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/classify/${params.id}`,
        method: 'PUT',
        data: params
    });
};
//获取APP功能池按钮编辑详情数据
export function getEditAppDetail (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/classify/${params.id}`,
        method: 'get',
        data: params
    });
};
// 功能池管理列表
export function getFunctionMangerList (params){
    return request({
        url:window.poIP+ "/app/pageResource/v0.1/modules",
        method: 'get',
        params: params
    });
};
//获取APP功能池管理编辑详情数据
export function getEditFunctionMangerDetail (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/modules/${params.id}/detail`,
        method: 'get',
        data: params
    });
};
//新增功能池管理
export function addFunctionManger (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/modules`,
        method: 'post',
        params: params
    });
};
//编辑功能池管理
export function editFunctionManger (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/modules/${params.id}`,
        method: 'PUT',
        data: params
    });
};
// 批量删除功能池管理
export function batchFunctionMangerDel (params){
    return request({
        url:window.poIP+ "/app/pageResource/v0.1/modules/list",
        method: 'DELETE',
        data: params,
        params: params,
        headContype:true
    });
};
// 单个删除功能池管理
export function siginFunctionMangerDel (params){
    return request({
        url:window.poIP+ `/app/pageResource/v0.1/modules/${params.id}`,
        method: 'DELETE'
    });
};
// 功能池导出

export function exportFunctionExcel (params){
    return request({
        url:window.poIP+ `/app/pageResource/export`,
        method: 'get',
        params:params,
        responseType: 'arraybuffer'
    });
};